package org.jeecg.modules.friends.enums;

/**
 * @author cold
 * @data 2024/5/27 11:27
 * @version 1.0
 */
public enum UserStatusEnum {
    UNKNOWN(0, "未知"),
    NORMAL(10, "正常"),
    FREEZE(20, "冻结"),
    CLOSING(30, "注销"),

    ;
    private int code;
    private String desc;

    UserStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static UserStatusEnum of(Integer status) {
        for (UserStatusEnum value : UserStatusEnum.values()) {
            if (value.getCode() == status) {
                return value;
            }
        }
        return UNKNOWN;
    }


    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
